<?php

/**
 * @Descripttion : FOXCMS 是一款高效的 PHP 多端跨平台内容管理系统
 * @Author : FoxCMS Team
 * @Date : 2023/6/26   16:30
 * @version : V1.08
 * @copyright : ©2021-现在 贵州黔狐科技股份有限公司 版权所有
 * @LastEditTime : 2023/6/26   16:30
 */

namespace app\api\controller;

use app\common\controller\ApiBase;
use think\facade\View;

class Web extends ApiBase
{
    // 广告位
    public function ad_show()
    {
        $pid = input("pid");
        $where = ["status" => 1, "advertising_space_id" => $pid];
        $adList = \app\common\model\Slide::where($where)->order('sort asc,id desc')->select()->each(function ($item, $key) {
            return $item['img_url'] = $this->addPrefix($item['img_url']);
        });
        View::assign("adList", $adList);
        $content = View::fetch();
        return response($content, 200, ['Content-Length' => strlen($content)])->contentType('text/html;charset=utf-8');
    }
}